﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:Microsoft.ProductivityHub.SilverlightBookshelf"
	mc:Ignorable="d"
	xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
	x:Class="Microsoft.ProductivityHub.SilverlightBookshelf.FeaturedVideoControl"
	d:DesignWidth="500" d:DesignHeight="325">

	<Grid x:Name="LayoutRoot" Margin="0,0,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid x:Name="TitleGrid" Margin="10,5,0,0" VerticalAlignment="Top" Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock FontSize="21.333" Foreground="{Binding Path=DarkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" Text="Featured Video" TextWrapping="NoWrap" VerticalAlignment="Center" Grid.Column="0"/>
			<Image HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10" Width="27" Source="../Images/Icon-Video1.png" Stretch="None" Grid.Column="1"/>
		</Grid>
        <Grid VerticalAlignment="Top" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <!--video player here-->
            <!--<Rectangle Fill="White" Stroke="Black" StrokeThickness="2" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10" Width="300" Height="225" Grid.Column="0"/>-->
            <Border BorderBrush="#FFF1F1F1" BorderThickness="1" Margin="10" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left">
            <MediaElement x:Name="MyPlayer" Stretch="Fill" Width="300" Height="225" 
                          Cursor="Hand">
                <ToolTipService.ToolTip>
                    
                        <TextBlock x:Name="MyPlayerTooltip" Margin="0" Text="Click to play video" FontFamily="Verdana" FontSize="12" Foreground="Black"/>
                    
                </ToolTipService.ToolTip>
            </MediaElement>
            </Border>
            <ItemsControl x:Name="videoContentControl" Grid.Column="1">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>


                            <TextBlock HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" FontFamily="Verdana" FontSize="14" FontWeight="Bold" 
                                       Text="{Binding Title}" TextWrapping="Wrap" Grid.Row="0" MaxWidth="200" Foreground="Black" MaxHeight="60"  />

                            <TextBlock HorizontalAlignment="Left" FontFamily="Verdana" FontSize="10" Foreground="#FF666666" TextWrapping="Wrap" 
                                       MaxWidth="200" Text="{Binding Abstract}" MaxHeight="120" Grid.Row="1"/>

                            <TextBlock HorizontalAlignment="Left" Margin="0,4,0,0" FontFamily="Verdana" Cursor="Hand" FontSize="11" 
                                       Foreground="{Binding Path=LinkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" 
                                       TextWrapping="Wrap" Grid.Row="2" Text="{Binding Product}" MaxWidth="200" MouseLeftButtonDown="Product_MouseLeftButtonDown"/>


                            <Grid Grid.Row="3">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock FontSize="11" FontFamily="Verdana" Foreground="Black" Text="Rating:" TextWrapping="NoWrap" Grid.Column="0" Margin="0,3,0,0"/>
                                <inputToolkit:Rating HorizontalAlignment="Left" Margin="-9, 0, 0, 0" ItemCount="5" Background="Transparent" Value="{Binding RatingValue}"
                                                         IsReadOnly="True" RenderTransformOrigin="0.5,0.5" Grid.Column="1" Foreground="{Binding Path=RatingGradientBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}">
                                    <inputToolkit:Rating.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform ScaleY="0.6" ScaleX="0.7"/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </inputToolkit:Rating.RenderTransform>
                                </inputToolkit:Rating>
                            </Grid>

                            <TextBlock HorizontalAlignment="Left" Margin="0,8,0,0" FontFamily="Verdana" FontSize="11" 
                                       Foreground="{Binding Path=LinkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" 
                                       TextWrapping="Wrap" Cursor="Hand" Tag="{Binding DocId}" Text="Tag as My Favorite" Grid.Row="4"  MouseLeftButtonDown="TagFavorite_MouseLeftButtonDown"/>

                            <TextBlock HorizontalAlignment="Left" Margin="0,8,0,0" FontFamily="Verdana" FontSize="11" 
                                       Foreground="{Binding Path=LinkColorBrush, Mode=OneWay, Source={StaticResource HubColorsDataSource}}" 
                                       TextWrapping="Wrap" Cursor="Hand" Text="Explore all videos..." Grid.Row="5" MouseLeftButtonDown="Explore_MouseLeftButtonDown"/>
                            
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

        </Grid>
            
	</Grid>
</UserControl>